package io.sdph.products.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Bean reprezentujący produkt.
 * 
 * @author Konrad Szewczyk
 * @since 0.0.1
 */
public class Product {

	/**
	 * Numer identyfikacyjny produktu.
	 */
	String id;

	/**
	 * Nazwa produktu.
	 */
	String name;

	/**
	 * Cena produktu.
	 */
	Double price;
	
	/**
	 * Kategoria produktu.
	 */
	String category;

	/**
	 * Opis produktu.
	 */
	String description;

	/**
	 * Linki do obrazków produktu.
	 */
	List<String> pictures;

	/**
	 * Dane dodatkowe o produkcie. Atrybut -> Opis dodatkowy
	 */
	Map<String, String> details;

	/**
	 * Konstruktor klasy.
	 * 
	 * @param id - identyfikator produktu
	 */
	public Product(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<String> getPictures() {
		if (pictures == null) {
			pictures = new ArrayList<String>();
		}
		return pictures;
	}

	public void setPictures(List<String> pictures) {
		this.pictures = pictures;
	}

	public Map<String, String> getDetails() {
		if (details == null) {
			details = new HashMap<String, String>();
		}
		return details;
	}

	public void setDetails(Map<String, String> details) {
		this.details = details;
	}

	public String getId() {
		return id;
	}

}
